<div style="clear:both;height:25px;"></div>
<div style="float:left; width:200px;margin-left:25px;display:block;height:auto;">
	<h2>Magazine</h2>
	<? foreach($cats as $cat) {?>
		<a href="<?=base_url()?>main/magazine/<?=$cat->slug?>"><?=$cat->name?></a><br />
	<? } ?>
</div>
<div style="float:left; width:830px;">
	<h1>Toate magazinele</h1>
	<?
	if($recommended) {
		echo "Aduna.ro recomanda: ";
		foreach($recomended as $recom) { 
		?>
		<div style="border:1px solid #eee;">
		
			<div style="float:left;width:100px;"><img src="#" style="width:100px;"></div>
			<div style="float:left;">descriere oferta</div>
			<div style="float:left;width:100px">PROCENT</div>
			<div style="clear:both;width:100%;height:2px;"></div>
			<div style="float:left;width:40%">Recomanda: </div>
			<div style="float:right;width:40%">ADUNA</div>
		</div>
		<div style="clear:both;width:100%;height:20px;"></div>
	<? 
		} 
	}
	?>
	<?
	if(isset($shops)&$shops) {
	?>
	<div style="">
		Sortare dupa:
		<select name="sort" onchange="location = this.options[this.selectedIndex].value;">
			<option></option>
			<option value="<?=base_url('/main/magazine/')?><?=($this->uri->segment(3)?$this->uri->slash_segment(3,'both'):'')?>" <?=(!$this->uri->segment(5)?'selected':'')?>>Popularitate</option>
			<option value="<?=base_url('/main/magazine/')?><?=($this->uri->segment(3)?$this->uri->slash_segment(3,'both'):'')?><?=($this->uri->segment(4)?$this->uri->slash_segment(4):'0/')?>percentage" <?=($this->uri->segment(5)=='percentage'?'selected':'')?>>Procent</option>
			<option value="<?=base_url('/main/magazine/')?><?=($this->uri->segment(3)?$this->uri->slash_segment(3,'both'):'')?><?=($this->uri->segment(4)?$this->uri->slash_segment(4):'0/')?>alphabetical" <?=($this->uri->segment(5)=='alphabetical'?'selected':'')?>>A - Z</option>
		</select>
		<? // | Toate | Subcateg. 1 | Subcateg. 2 *} ?>
	</div>
	
	<div id="shops">
		<?
			foreach($shops as $shop) { 
			?>
			<div style="border:1px solid #eee;">
				<div style="float:left;width:100px;"><img src="<?=base_url()?>assets/uploads/<?=$shop->image?>" style="width:100px;"></div>
				<div style="float:left;"><?=$shop->description?></div>
				<div style="float:left;width:100px"><?=$shop->percentage?></div>
				<div style="clear:both;width:100%;height:2px;"></div>
				<div style="float:left;width:40%">Recomanda: </div>
				<div style="float:right;width:40%">ADUNA</div>
				<div style="clear:both;"></div>
			</div>
		<? 
		} 
		?>
	</div>
	<?=$pagination?>
	<? } else { ?>
		Nu exista magazine in aceasta categorie!
	<? } ?>
</div>
<div style="clear:both;height:25px;"></div>